Ext.application({
    name: 'ArvoreKD',
    
    appFolder: 'app',
	
	controllers: [
		'Arvores'
	],
	
    launch: function(){
        Ext.create('Ext.container.Viewport', {
            layout: 'border',
            items: [{
                region: 'north',
                html: '<img style="float:left; margin-left: 15px;" src="resources/images/arvore.png"></img><img style="float:left; margin-left: 30px;" src="resources/images/texto-north.png"></img>',
                height: 64,
                border: false,
                margins: '5 5 0 5',
                bodyStyle: {
                    background: 'rgb(223,232,246)',
                    border: 'rgb(223,232,246)'
                }
            }, {
                region: 'east',
                margins: '5 5 5 0',
                title: '<center>Representa&ccedil;&atilde;o em gr&aacute;fico</center>',
                width: '40%'
            }, {
                region: 'center',
                title: '<center>Representa&ccedil;&atilde;o em &aacute;rvore</center>',
                margins: '5 5 5 5',
				bodyStyle: {
					padding: '5px'
	            },
				items: [{
					xtype: 'form',
					border: false,
					frame: true,
					defaults: {
						labelWidth: 40,
						cls: 'fieldcontainer',
	                    layout: {
	                        type: 'hbox',
							align: 'middle',
	                        defaultMargins: {top: 0, right: 5, bottom: 0, left: 0}
	                    }
	                },
					items: [{
	                    xtype: 'fieldcontainer',
	                    fieldLabel: '',
						labelSeparator: '',
						width: 160,
	                    combineErrors: true,
	                    msgTarget: 'under',
	                    defaults: {
	                        hideLabel: true
	                    },
	                    items: [{
	                        xtype: 'displayfield',
	                        value: '('
	                    }, {
	                        xtype: 'numberfield',
	                        name: 'coord-x',
							hideTrigger: true,
	                        width: 29,
	                        allowBlank: false,
							cls: 'number',
							emptyText: 'x',
							enableKeyEvents: true,
							blankText: 'Coordenada x &eacute; obrigat&oacute;ria.'
	                    }, {
	                        xtype: 'displayfield',
	                        value: ','
	                    }, {
	                        xtype: 'numberfield',
	                        name: 'coord-y',
							hideTrigger: true,
	                        width: 29,
	                        allowBlank: false,
							cls: 'number',
							emptyText: 'y',
							enableKeyEvents: true,
							blankText: 'Coordenada y &eacute; obrigat&oacute;ria.'
	                    }, {
	                        xtype: 'displayfield',
	                        value: ')'
	                    }, {
							xtype: 'button',
							action: 'inserir',
							text: 'inserir',
							iconAlign: 'top',
							iconCls: 'inserir',
							margins: '0 0 0 20'
						}]
	                }]
				}]
            }]
        });
    }
});
